<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="c='blue'">修改颜色</button>
      <!-- div的color没有写死，根据变量c来 -->
      <!-- <div v-bind:style="{ color: c }">我是div</div> -->

      <!-- 动态和静态（写死）可以一起用 -->
      <!-- 以后写死的不加冒号，不写死的加冒号 -->
      <div
        :style="{ color: c, fontSize: fz }"
        style="border: 1px solid black; width:300px;"
      >
        我是div
      </div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            c: 'red',
            fz: '40px'
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
